// Copyright (c) 2009 Mike Haight, Andy Kipp
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

#pragma once

#include "stdafx.h"

namespace HandBanana { namespace Core
{
    /// Class definition standard of correctitude.
    ///
    /// For code readability, whitespace is your friend :)
    ///
    /// Definitions:
    ///     SECTION:              A SECTION is defined as a SECTION HEADER followed by a group of CLASS MEMBERS.
    ///     SECTION HEADER:       A SECTION HEADER is a COMMENT followed on the next line by a MEMBER SCOPE KEYWORD.
    ///     CLASS MEMBER:         A CLASS MEMBER is a FUNCTION or a DATA MEMBER.
    ///     MEMBER SCOPE KEYWORD: public, protected, private.
    ///
    /// 1. The class name shall be on its own line.
    /// 2. The class opening brace shall be on the next line following the class name.
    /// 3. The first SECTION shall be on the next line following the class opening brace.
    /// 4. The first CLASS MEMBER of each SECTION shall be on the next line following the SECTION HEADER.
    /// 5. There shall be one new line following each CLASS MEMBER.
    /// 6. Adjacent DATA MEMBERS may omit the new line required by rule 5 where appropriate.
    /// 7. There shall be one new line following each section except for the last (this is cumulative with rule 5).
    /// 8. The class closing brace shall be on its own line.
    ///
    /// Example follows:
    ///
    /// <summary>
    /// Class summary.
    /// </summary>
    /// class Example
    /// {
    /// // First Section Header
    /// public:
    ///     void Method1();
    ///
    ///     int Method2();
    ///
    ///
    /// // Second Section Header
    /// protected:
    ///     void Methods3();
    ///
    ///     int Method4();
    ///
    ///
    /// // Third Section Header
    /// private:
    ///     int privateDataMember1;
    ///     int privateDataMember2;
    ///
    ///     bool privateDataMember3;
    ///     bool privateDataMember4;
    ///
    /// };


    /// <summary>
    /// Base class for all classes.
    /// </summary>
    class Object
    {
    // Constructor
    public:
        /// <summary>
        /// Initializes a new instance of the Object class.
        /// </summary>
        Object(void) { }


    // Destructor
    public:
        /// <summary>
        /// Destroys all resources held by the instance.
        /// </summary>
        virtual ~Object(void) { }


    // Public Methods
    public:
        /// <summary>
        /// Returns a hash code for this Object class.
        /// </summary>
        virtual int HashCode(void) const { return (int)this; }

        /// <summary>
        /// Returns true if this Object class is equal to the provided Object.
        /// </summary>
        virtual bool Equals(const Object& argOther) const { return (this == &argOther); }

        /// <summary>
        /// Returns the string representation of the class.
        /// </summary>
        virtual std::wstring ToString(void) const { return L"Object"; }

    };
} }